﻿using LightingPlatform.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace LightingPlatform.View.Level2
{
    public partial class LableItem : UserControl
    {
        private object _originalSource;

        public LableItem()
        {
            InitializeComponent();

            Pictures.SelectionChanged += Pictures_SelectionChanged;
        }

        public Frame Navigation
        {
            get;
            set;
        }

        private void Pictures_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            LightingClassModel lighting = (LightingClassModel)Pictures.SelectedItem;

            CondProdSeries.Builder builder = new CondProdSeries.Builder();

            //QueryParameter2 parameter = LightingContext.Singleton.QueryParameter2;
            //if (parameter.HasUsePlace)
            //    builder.SetUsePlace(parameter.UsePlace);

            //if (parameter.HasSetup)
            //    builder.SetSetup(parameter.Setup);

            //if (parameter.HasClass)
            //    builder.SetProductClass(parameter.Class);

            //if (!string.IsNullOrEmpty(lighting.Lable))
            //    builder.SetLable(lighting.Lable);

            //if (!string.IsNullOrEmpty(lighting.Series))
            //    builder.SetSeries(lighting.Series);

            //if (lighting.AdapterLighting != null && lighting.AdapterLighting.Class > 0)
            //    builder.SetAdpaterClass(lighting.AdapterLighting.Class);

            //LightingContext.Singleton.QueryParameter3 = builder.Build();
            //LightingContext.Singleton.MainPageNavigated = false;
            //LightingContext.Singleton.Navigation.Navigate(new Uri("/View/Level3/LightingListView.xaml", UriKind.RelativeOrAbsolute));
        }
    }
}
